﻿using Ninject.Extensions.Conventions;
using Ninject.Modules;

namespace NInject.Practice.NinjectModules
{
    public class HandlerModule:NinjectModule
    {
        public override void Load()
        {
            Kernel.Bind(x => x.FromThisAssembly()
                   .SelectAllClasses().InheritedFrom(typeof(IHandler<>))
                   .BindAllInterfaces()
                   );
        }
    }
}